package com.combetter.changxing.ui.base;

import android.databinding.ViewDataBinding;
import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * 自定义BaseViewHolder
 * <p>
 * 作者: Chen
 * 日期: 2018/10/26 15:33
 */
public class BaseBindingViewHolder<T extends ViewDataBinding> extends BaseViewHolder {
    private T binding = null;

    public BaseBindingViewHolder(T binding) {
        super(binding.getRoot());
        binding.getRoot().setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
        this.binding = binding;
    }

    public BaseViewHolder setQAdapter(BaseQuickAdapter adapter) {
        super.setAdapter(adapter);
        return this;
    }

    public T getDataViewBinding() {

        return  binding;
    }

}
